package com.itheima07;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class HuoLeDuoJiu {
    public static void main(String[] args) throws Exception {
        String now = "2020年8月14日";
        String birthday = "2020年8月1日";

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");

        Date d1 = sdf.parse(now);
        Date d2 = sdf.parse(birthday);

        long time1 = d1.getTime();
        long time2 = d2.getTime();

        long dayNum = (time1 - time2) / (1000 * 60 * 60 * 24);
        System.out.println("dayNum = " + dayNum);
    }
}
